var timerobj, timer;
mui.init({
	pullRefresh: {
		container: '#pullrefresh',
		down: { //下拉刷新
			callback: pulldownRefresh,
			style: mui.os.android ? "circle" : "default"
		}
	}
});



mui.plusReady(function() {

	initPage();

	//跳转扫码
	document.getElementById('jumpToScane').addEventListener('tap', function() {
		openNew("../widget/richScan.html");
	})
	//左上角选择状态
	document.getElementById("selectType").addEventListener('tap', function() {
		var btnArray = [{
			title: "未完成"
		}, {
			title: "有问题"
		}, {
			title: '已完成'
		}];
		plus.nativeUI.actionSheet({
			title: "选择类型",
			cancel: "取消",
			buttons: btnArray
		}, function(e) {
			var index = e.index;
			var text = "你刚点击了\"";
			switch (index) {
				case 0:
					text += "取消";
					break;
				case 1:
					text += "拍照或录像";
					break;
				case 2:
					text += "选取现有的";
					break;
			}
			info.innerHTML = text + "\"按钮";
		});
	});

})

function initPage() {
	loadData();
}
//下拉刷新具体业务实现
function pulldownRefresh() {
	loadData();
}
//一次性拉取数据
function loadData() {
	/*request("/Index/getIndexLis", {
		lon: lon,
		lat: lat,
		cityid: storageLocation.CityId
	}, function(json) {
		if (json.code == "0") {

		} else {
			appUI.showTopTip(json.msg)
		}
		appPage.endPullRefresh();
	}, false, function() {
		appPage.endPullRefresh();
		var arr = document.getElementsByClassName("nodata");
		for (var i = 0; i < arr.length; i++) {
			arr[i].innerText = "暂无数据";
		}
	});*/
}
